package com.rockcent.mall.lib.repository;

import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.AuthResource;
import com.rockcent.mall.lib.domain.AuthTitleResource;
import com.rockcent.mall.lib.domain.enumclass.SystemType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by anti on 2016-08-22.
 */
@Repository
public interface AuthTitleResourceRepository extends JpaRepository<AuthTitleResource, Long>, JpaSpecificationExecutor {

    List<AuthTitleResource> findByTitleId(Long titleId);

    List<AuthTitleResource> findByResourceIdAndIsDelete(Long resourceId, Whether no);

    List<AuthTitleResource> findByOwnerIdAndSystemTypeAndIsDelete(Long id, SystemType systemType, Whether no);
}

